﻿#ifndef OPENCLMANAGER_H
#define OPENCLMANAGER_H

#include <QObject>
#define __CL_ENABLE_EXCEPTIONS
#include <CL/cl.hpp>

class OpenCLManager : public QObject
{
    Q_OBJECT
public:
    explicit OpenCLManager(QObject *parent = nullptr);
    ~OpenCLManager();

    bool initialize();
    QString getDeviceInfo();

    cl::Context& context() { return m_context; }
    cl::Device& device() { return m_device; }
    cl::CommandQueue& queue() { return m_queue; }

private:
    cl::Platform m_platform;
    cl::Device m_device;
    cl::Context m_context;
    cl::CommandQueue m_queue;
    bool m_initialized = false;
};

#endif // OPENCLMANAGER_H
